package org.az;

import org.apache.commons.lang.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.Period;
import org.joda.time.PeriodType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Hello world!
 */
public class App {
	private static final Logger log = LoggerFactory.getLogger(App.class);
	public static void main(String[] args) {
		log.info("main running");
		String name = "AZ";
		DateTime now = new DateTime();
		System.out.println("1) Hello " + name + ", it is now " + now);
		DateTime oct29 = new DateTime(2011, 10, 29, 0, 0);
		Period p = new Period(oct29, now, PeriodType.dayTime());
		System.out.println("2) It has been "+p.getDays()+" days, "+p.getHours()+" hours, and "+p.getMinutes()+" mins since "+oct29.toString("MMM d, y"));
		long time = System.currentTimeMillis();
		System.out.println("3) There are "+StringUtils.countMatches(time+"", "1")+" '1's in "+time);
	}
}
